<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>${title }</title>
  <link rel="stylesheet" href="${basePath}/static/bootstrap/css/bootstrap.css"/>
    <link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/login.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
	<script  type="text/javascript" src="${basePath}/static/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}/static/page/jqPaginator/jqPaginator.js"></script>
    
</head>
<body>
<!--头部-->
	<%@include file="/WEB-INF/templates/common/header.jsp"%>
	<!------导航条-->
	<%@include file="/WEB-INF/templates/common/navigation.jsp"%>

<!--内容部分-->
<div class="list_main lay_out" class="clearfix">
    <div class="list_DH">
        <%@include file="/WEB-INF/templates/common/sourceofpatients.jsp"%>
    </div>
    <div class="list_NR">
        <div class="loc">
            <h3 style="margin:0">县区病人来源</h3>
        </div>
        <div class="list_con_table">
            <div class="search_table">   
			  <ul class="clearfix" style="margin-bottom:0;">
				<li class="Label_1">出院日期：&nbsp;</li>
			    <li class="Label_2" style="text-align:left;padding-left:3px;width:300px">
			    <input class="Wdate input" style="width:130px;" type="text"  name='' id='' value='' onFocus="WdatePicker()" />
			    <span>&nbsp;-&nbsp;</span>
				<input class="Wdate input" style="width:130px;" type="text"  name='' id='' value='' onFocus="WdatePicker()" />
			    </li>
			    <li class="Label_1">请选择省：&nbsp;</li>
						    <li class="Label_2"  style="width: 128px;">
						         <select id="" name="" class="input_box">
						         	<option id="" value="" >1</option>
						         	<option id="" value="" >2</option>
						         	<option id="" value="" >3</option>
						         </select>   
							</li>
				<li class="Label_1">请选择市：&nbsp;</li>
						    <li class="Label_2"  style="width: 128px;">
						         <select id="" name="" class="input_box">
						         	<option id="" value="" >1</option>
						         	<option id="" value="" >2</option>
						         	<option id="" value="" >3</option>
						         </select>   
							</li>
			     <li class="Label_1">出院科室：&nbsp;</li>
			     <li class="Label_2"><input class="input_box" type="text"  name='' id='' value='' /></li>
			     <li class="Label_5"><a onclick="searchQua()">统计</a></li>
			  </ul>
            </div>
        </div> 
	</div>
</div>

<!------页脚部分--------->
<%@include file="/WEB-INF/templates/common/footer.jsp"%>

<!--JS部分-->
<script type="text/javascript">
$(function() {
	var shengopt = $("#shengId");
	$.post("http://localhost:8080/CMDP/tubiao/getShengSelect", {}, function(data) {
		for ( var index in data) {
			var Obj = data[index];
			var code = Obj.code;
			var name = Obj.name;
			var opt = $("<option>").val(code).text(name);
			shengopt.append(opt);
		}
		var shengVal=$("#shengVal_Id").val();
		if(shengVal){
		     shengopt.val(shengVal);
		}
	}, 'json');
	function checkEnd() {
		//某种情况下显示图片，停止转动
		$.post("http://localhost:8080/CMDP/tubiao/checkRenShuFenBuStatus", null, function(data) {
			var shist = data['shi'];
			if (shist == 1) {
				$("#shi").show();
				$("#tjimg").hide();
				clearInterval(checkId);
				$.post("http://localhost:8080/CMDP/tubiao/resetRenShuFenBuStatus", null,
						function(data) {
						}, 'json');
			}

		}, 'json');
	}
	$("#subBTId")
			.click(
					function() {
						var startIime = $("#startT").val();
						var endTime = $("#endT").val();
						if (startIime && endTime) {
							var ksbms = $("#cyksSelectId").val();
							var dateSys = new Date().getTime();
							///////////
							var sheng = $("#shengId option:selected").val();
							if (sheng) {
								var sbtEle = document
										.getElementById("tjimg");
								sbtEle.style.display = "block";
								//////////////////////////统计省下市的状况****************
								var thisText = $("#shengId option:selected")
										.text();
								if (thisText.length == (thisText
										.indexOf('市') + 1)) {
								window.location.href ="http://localhost:8080/CMDP/tubiao/diquBingForShi1?tcd.xingzhidm="
																+ sheng
																+ "&tcd.zhixiashi=1"
																+ "&tcd.startTime="
																+ startIime
																+ "&tcd.endTime="
																+ endTime
																+ "&tcd.ksbms="
																+ ksbms
																+ "&d="
																+ dateSys;
									//直辖市情况下
								} else {
								window.location.href ="http://localhost:8080/CMDP/tubiao/diquBingForShi1?tcd.xingzhidm="
																+ sheng
																+ "&tcd.startTime="
																+ startIime
																+ "&tcd.endTime="
																+ endTime
																+ "&tcd.ksbms="
																+ ksbms
																+ "&d="
																+ dateSys;
								}
								//////////////////////////统计省下市的状况end****************
								///判断是否执行完方法
								//checkId = setInterval(checkEnd, 2000);
							} else {
								alert("请选择省份！！");
							}
						} else {
							alert("请选择时间段！！");
						}
					});
	//////////统计按钮  end
	// /////////////出院科室////////////////////
	var ksDivStr = "ksDiv";
	$("#" + ksDivStr).hide();
	$("#cyksSelectId").click(function() {
		$("#mainContentKS").attr("src", "http://localhost:8080/CMDP/bingan/basy/selectCYKS.jsp");
		$("#" + ksDivStr).show();
		return false;
	});

});

</script>


</body>
</html>